package com.lac.component.test.singleton;

/**
 * @author xiaokuixiao
 * date2025/4/9 13:38
 */
// 饿汉式双重检查
class Singleton06{
    private static volatile Singleton06 instance;
    private Singleton06(){

    }


    public static  Singleton06 getInstance(){
        if (instance == null){ //未创建才创建
            synchronized (Singleton06.class){
                instance = new Singleton06();
            }
        }
        return instance;
    }

}